package com.itheima.Jiuye04;

import java.util.Random;

public class RandomNumDame {
    public static void main(String[] args) {
        RandomNum1(new RandomNum() {
            @Override
            public int getNum() {
           Random r = new Random();
           int a = r.nextInt(10)+1;
                return a;
            }
        });
        RandomNum1(()->{ Random r = new Random();
            int a = r.nextInt(10)+1;
            return a;});
    }
    public static void RandomNum1(RandomNum randomNum){
        int a = randomNum.getNum();
        System.out.println(a);
    }
}
interface RandomNum{
    int getNum();
}